package cate.game.res.furniturecall;

import cate.game.db.facade.KvLoader;
import cate.game.db.mongo.kv.KvMongo;
import cate.game.framework.ModuleMan;

import java.util.List;

public class FurnitureCallManager extends ModuleMan {
    private FurnitureCallSPO status;
    @Override
    public void initDependent() throws Exception {
        status = new KvLoader<>(game, FurnitureCallSPO.class, KvMongo.KEY_FURNITURE_CALL_DATA).getBySrvId();
    }

    public void addLog(String name, int rewardId){
        status.addLog(name, rewardId);
    }

    public List<FurnitureCallLog> getLogs(){
        return status.logs;
    }

    @Override
    public void shutdown(){
        game.db.kv.save(status);
    }
}
